const studentNameKey = "f-student-name";
const studentPwdKey = "f-student-pwd";

export function setAccount({ username, password }) {
  window.localStorage.setItem(studentNameKey, username);
  window.localStorage.setItem(studentPwdKey, password);
}

export function removeAccount() {
  window.localStorage.removeItem(studentNameKey);
  window.localStorage.removeItem(studentPwdKey);
}

export function getAccount() {
  const username = window.localStorage.getItem(studentNameKey);
  const password = window.localStorage.getItem(studentPwdKey);
  return {
    username,
    password,
  };
}
